//
//  CMDBPublishButton.swift
//  CMDB
//
//  Created by 曹桂祥 on 17/4/14.
//  Copyright © 2017年 CMDB. All rights reserved.
//

import UIKit

class CMDBPublishButton: UIButton {

    required override init(frame: CGRect) {
        super.init(frame: frame)
        
        buildSubViews()
    }
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func buildSubViews() {
        
        super.buildSubViews()
        
        titleLabel?.font          = CMDB_12_FONT
        
        titleLabel?.textAlignment = .Center
        
        setTitleColor(word87Color, forState: .Normal)
        
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
        imageView?.centerX  = 57 * 0.5
        
        imageView?.y        = 0
        
        imageView?.width    = 57
        
        imageView?.height   = 57
        
        titleLabel?.x       = 0
        
        titleLabel?.y       = CGRectGetMaxY((imageView?.frame)!) + 5
        
        titleLabel?.width   = 57
        
        titleLabel?.height  = 12
        
    }
}
